package com.rawchen.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 博客分类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Category {
	@TableId(type = IdType.AUTO)
	private Long id;

	/** 分类名称 */
	@TableField("category_name")
	private String name;

	/** 该分类下的博客文章 */
	@TableField(exist = false)
	private List<Blog> blogs = new ArrayList<>();
}
